#include <iostream>
#include <vector>
#include <string>

using namespace std;

class Solution01 {
public:
    int searchInsert(vector<int>& nums, int target) {
        int left = 0, right = nums.size();
        while (left < right) {
            int mid = left + (right - left) / 2;
            if (nums[mid] == target) return mid;
            else if (nums[mid] < target) left = mid + 1;
            else right = mid;
        }
        return left;
    }
};

class Solution02 {
public:
    int mySqrt(int x) {
        if (x < 1) return 0;
        int left = 1, right = x;
        
        while (left < right) {
            long long mid = left + (right - left + 1) / 2;
            if (mid * mid <= x) left = mid;
            else right = mid - 1;
        }
        return left;
    }
};

int main() {


    return 0;
}